package com.silence.gmall.product.job;

import com.silence.gmall.handler.LoggerHandler;
import com.silence.gmall.product.service.SkuInfoService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.springframework.stereotype.Component;

/**
 * @Author silence
 * @Date 2025-09-08 11:02
 * @Email 792245022@qq.com
 * @Version 1.0
 * @Description sku 信息的定时任务处理器
 */
@Component
@RequiredArgsConstructor
public class SkuInfoXxlJobHandler {

    /**
     * 日志注入
     */
    private static final Logger log = LoggerHandler.createLogger(SkuInfoXxlJobHandler.class);

    /**
     * sku 信息服务
     */
    private final SkuInfoService skuInfoService;

    /**
     * 同步SKU信息主键集合信息
     **/
    @XxlJob("SyncSkuInfoIdList")
    public ReturnT<String> syncSkuInfoIdList() {
        // 同步SKU信息主键集合信息
        skuInfoService.syncSkuInfoIdList();
        return ReturnT.SUCCESS;
    }

}
